]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
build: Use new mkenums_simple() function
authorFlorian Müllner <fmuellner@gnome.org>
Tue, 15 Aug 2017 19:54:48 +0000 (21:54 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Fri, 22 Sep 2017 15:43:54 +0000 (17:43 +0200)
As most libraries use the same mkenums templates, meson now added a
mkenums_simple() variant that works without providing the template.

https://bugzilla.gnome.org/show_bug.cgi?id=786343

src/meson.build
src/shell-enum-types.c.in [deleted file]
src/shell-enum-types.h.in [deleted file]
src/st/meson.build
src/st/st-enum-types.c.in [deleted file]
src/st/st-enum-types.h.in [deleted file]

index 1e88bf5d51ca609c778ec8f23982569ee5173d42..3e5557351f19eebd9a28e0c4d7ea1fc769daf731 100644 (file)
@@ -182,10 +182,8 @@ if enable_recorder
 endif
 
 
-libshell_enums = gnome.mkenums('shell-enum-types',
-  sources: libshell_public_headers,
-  c_template: 'shell-enum-types.c.in',
-  h_template: 'shell-enum-types.h.in'
+libshell_enums = gnome.mkenums_simple('shell-enum-types',
+  sources: libshell_public_headers
 )
 
 libshell_gir_sources = [
diff --git a/src/shell-enum-types.c.in b/src/shell-enum-types.c.in
deleted file mode 100644 (file)
index b350d00..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*** BEGIN file-header ***/
-#include "shell-enum-types.h"
-/*** END file-header ***/
-
-/*** BEGIN file-production ***/
-/* enumerations from "@filename@" */
-#include "@filename@"
-/*** END file-production ***/
-
-/*** BEGIN value-header ***/
-GType
-@enum_name@_get_type(void) {
-  static GType enum_type_id = 0;
-  if (G_UNLIKELY (!enum_type_id))
-    {
-      static const G@Type@Value values[] = {
-/*** END value-header ***/
-
-/*** BEGIN value-production ***/
-        { @VALUENAME@, "@VALUENAME@", "@valuenick@" },
-/*** END value-production ***/
-
-/*** BEGIN value-tail ***/
-        { 0, NULL, NULL }
-      };
-      enum_type_id = g_@type@_register_static("@EnumName@", values);
-    }
-  return enum_type_id;
-}
-/*** END value-tail ***/
diff --git a/src/shell-enum-types.h.in b/src/shell-enum-types.h.in
deleted file mode 100644 (file)
index a6aea7d..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-/*** BEGIN file-header ***/
-#ifndef __SHELL_ENUM_TYPES_H__
-#define __SHELL_ENUM_TYPES_H__
-
-#include <glib-object.h>
-
-G_BEGIN_DECLS
-
-/*** END file-header ***/
-
-/*** BEGIN file-production ***/
-/* enumerations from "@filename@" */
-/*** END file-production ***/
-
-/*** BEGIN file-tail ***/
-G_END_DECLS
-
-#endif /* !__SHELL_ENUM_TYPES_H__ */
-/*** END file-tail ***/
-
-/*** BEGIN value-header ***/
-GType @enum_name@_get_type (void) G_GNUC_CONST;
-#define SHELL_TYPE_@ENUMSHORT@ (@enum_name@_get_type())
-
-/*** END value-header ***/
index 46378a2f1a683f16e6ed7804fafc12214f8af63d..fa9d6bbf48bef00b9bde89f72ea5e0fc07da335c 100644 (file)
@@ -82,10 +82,12 @@ st_sources = [
   'st-widget.c'
 ]
 
-st_enums = gnome.mkenums('st-enum-types',
+st_enums = gnome.mkenums_simple('st-enum-types',
   sources: st_headers,
-  c_template: 'st-enum-types.c.in',
-  h_template: 'st-enum-types.h.in'
+  header_prefix: '''
+#if !defined(ST_H_INSIDE) && !defined(ST_COMPILATION)
+#error "Only <st/st.h> can be included directly.h"
+#endif'''
 )
 
 st_gir_sources = st_sources + st_private_headers + st_headers + st_enums
diff --git a/src/st/st-enum-types.c.in b/src/st/st-enum-types.c.in
deleted file mode 100644 (file)
index bf0c544..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*** BEGIN file-header ***/
-#ifndef ST_COMPILATION
-#define ST_COMPILATION
-#endif
-#include "st-enum-types.h"
-/*** END file-header ***/
-
-/*** BEGIN file-production ***/
-/* enumerations from "@filename@" */
-#include "@filename@"
-/*** END file-production ***/
-
-/*** BEGIN value-header ***/
-GType
-@enum_name@_get_type(void) {
-  static GType enum_type_id = 0;
-  if (G_UNLIKELY (!enum_type_id))
-    {
-      static const G@Type@Value values[] = {
-/*** END value-header ***/
-
-/*** BEGIN value-production ***/
-        { @VALUENAME@, "@VALUENAME@", "@valuenick@" },
-/*** END value-production ***/
-
-/*** BEGIN value-tail ***/
-        { 0, NULL, NULL }
-      };
-      enum_type_id = g_@type@_register_static (g_intern_static_string ("@EnumName@"), values);
-    }
-  return enum_type_id;
-}
-/*** END value-tail ***/
diff --git a/src/st/st-enum-types.h.in b/src/st/st-enum-types.h.in
deleted file mode 100644 (file)
index b3dd0e7..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/*** BEGIN file-header ***/
-#if !defined(ST_H_INSIDE) && !defined(ST_COMPILATION)
-#error "Only <st/st.h> can be included directly.h"
-#endif
-
-#ifndef __ST_ENUM_TYPES_H__
-#define __ST_ENUM_TYPES_H__
-
-#include <glib-object.h>
-
-G_BEGIN_DECLS
-
-/*** END file-header ***/
-
-/*** BEGIN file-production ***/
-/* enumerations from "@filename@" */
-/*** END file-production ***/
-
-/*** BEGIN file-tail ***/
-G_END_DECLS
-
-#endif /* !__ST_ENUM_TYPES_H__ */
-/*** END file-tail ***/
-
-/*** BEGIN value-header ***/
-GType @enum_name@_get_type (void) G_GNUC_CONST;
-#define ST_TYPE_@ENUMSHORT@ (@enum_name@_get_type())
-
-/*** END value-header ***/